import React, { Component } from "react";
import "./Fast.less";
import Subject from "../../images/subject.png";
import { FastApi } from "../../request/api";
export default class Fast extends Component {
  state = {
    //   列表数组
    records: [],
  };
  render() {
    return (
      <ul className="fastbox">
        {this.state.records.map((item) => {
          return (
            <li key={item.id}>
              <div className="left">
                <img src={Subject} alt="" />
              </div>
              <div className="center">{item.title}</div>
              <div className="ti_right">刷题</div>
            </li>
          );
        })}
      </ul>
    );
  }
  componentDidMount() {
    //   刷题列表数据请求
    FastApi().then((res) => {
      //   console.log(res);
      if (res.errCode === 0) {
        // console.log(res.data);
        let { records } = res.data;
        this.setState({ records });
      }
    });
  }
}
